package Xunhuan;

import jdk18.entity.Staff;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @Description xx
 * @Author zhongzihao
 * @Date 2021/7/27 9:33 上午
 */
public class test2 {
    public static void main(String[] args) {
//        test1();
        test2_1();
    }

    public static void test1() {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
        for (int i :
                list) {
            if(i==2){
                continue;
            }
            System.out.println(i);
        }
    }
    public static List<Staff> test2(List<Staff> staff){
        Iterator<Staff> it = staff.iterator();
        while (it.hasNext()){
            if (it.next().getAge() == 27 && StringUtils.isNotBlank(it.next().getName())){
                it.remove();
            }
        }
//        staff.removeIf(staff1 -> staff1.getAge() == 27&&staff1.getName().equals("jack"));
        return staff;
    }
    public static void test2_1(){
       Staff s =  new Staff("ricky", 30, new BigDecimal(10000));
       Staff s1= new Staff("jack", 27, new BigDecimal(20000));
       Staff s2 =  new Staff("lawrence", 33, new BigDecimal(30000));
       String s3 = new String();
        List<Staff> staff = new ArrayList<>();
        staff.add(s);
        staff.add(s1);
        staff.add(s2);

//        List<Staff> nullList = null;
        List<Staff> r3 = test2(staff);
        System.out.println(staff);
        System.out.println(r3);
    }

//    public void test(){
//        test5()
//    }
}
